from collections import deque

q = deque()
q.append(1)  # 入队列
data = q.popleft()  # 出队列
print(data)

q = deque([1,2,3,4,5],5)
q.append(1)  # 入队列
data = q.popleft()  # 出队列
print(data)